package com.lwc.cfdns.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lwc.cfdns.pojo.BaseEntity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.lwc.cfdns.pojo.dto.ValidGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 通知公告表
 *
 * @TableName cfdns_system_notice
 */
@TableName(value = "cfdns_system_notice", resultMap = "systemNoticeResultMap")
@Data
public class SystemNotice extends BaseEntity implements Serializable {
    /**
     * 公告ID
     */
    @TableId(type = IdType.AUTO)
    @NotNull(message = "ID不能为空", groups = {ValidGroup.Update.class})
    private Long id;

    /**
     * 公告标题
     */
    @NotBlank(message = "标题不能为空", groups = {ValidGroup.Create.class, ValidGroup.Update.class})
    @Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
    private String title;

    /**
     * 分类（1通知 2公告）
     */
    @NotNull(message = "分类不能为空", groups = {ValidGroup.Update.class, ValidGroup.Create.class})
    private Long cateId;

    /**
     * 公告状态（0正常 1关闭）
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 公告内容
     */
    private String content;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private String cateName;
}